<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
	<h:head>
		<title>Edit Schedule</title>
		<h:outputStylesheet library="css" name="main.css" />
	</h:head>
	<h:body>
		<!-- Must be logged-in to view oldTimeSheets page -->
		<h:panelGroup rendered="#{credentials.isLoggedIn()}">
		
			<ui:insert name="header" >
			  	<ui:include src="/templates/header.xhtml" />
			</ui:insert>
			
			<h:panelGroup>
				<h:form>
					<h:selectOneMenu value="#{scheduler.pastWeekNum}">
						<f:selectItems value="#{scheduler.weekCount}"/>	
						<f:ajax render="table2" event="change" execute="@all"/>				
					</h:selectOneMenu>
					
					<h:dataTable id="table2"  value="#{scheduler.pastWeek}" var="oldTimeSheet" border="1">
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.projectheading}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.project}"></h:inputText>
							<f:facet name="footer">					
								<h:outputText value="#{msgs.total}" style="font-weight:bold"/>
							</f:facet>
						</h:column>	
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.wp}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.wp}"></h:inputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.total}"/>
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.total}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.columnTotal}" style="width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.sat}" />
							</f:facet>					
							<h:inputText readonly="true" value="#{oldTimeSheet.sat}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.satTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.sun}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.sun}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.sunTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.mon}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.mon}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.monTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.tue}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.tue}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.tueTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.wed}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.wed}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.wedTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.thu}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.thu}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.thuTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.fri}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.fri}"></h:inputText>
							<f:facet name="footer">	
								<h:outputText value="#{scheduler.friTotal}" style=" width : 147px;"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="#{msgs.notes}" />
							</f:facet>
							<h:inputText readonly="true" value="#{oldTimeSheet.notes}"></h:inputText>
						</h:column>
					</h:dataTable>
				</h:form>
			</h:panelGroup>
			
		<!-- End of Login required section -->
		</h:panelGroup>
		
		<!-- Not logged-in viewers will be able to view this section -->
		<h:panelGroup rendered="#{!credentials.isLoggedIn()}">
			<ui:insert name="notLogIn" >
		  		<ui:include src="/templates/notLogIn.xhtml" />
			</ui:insert>
		</h:panelGroup>
	</h:body>
</html>
